package com.wendu.单例模式.懒汉式;

public class Instance {
    private static Instance instance;
    private Instance(){
        System.out.println("懒汉式单例模式");
    }
    public synchronized static Instance getInstance(){
        if(instance == null){
            instance = new Instance();
        }
        return instance;
    }
}
